import pytest
import requests
from jsonpath import jsonpath

@pytest.fixture()
def  login_fixture():
    res = requests.request(method="post",url="http://shop.lemonban.com:8107/login",json={"principal": "lemon_py", "credentials": "12345678", "appType": 3, "loginType": 0})
    access_token = jsonpath(res.json(),"$..access_token")
    token_type = jsonpath(res.json(),"$..token_type")
    token = token_type + access_token
    yield token


